﻿/**********************************************************************************
 * Description:     
 * MemberVariable:
 * Functions:       
 * Modify information:     
 * 2008-8-5     New           DuYaoHui     Create Class
 * 
 * ********************************************************************************/
using System;

using System.Configuration;
//using Fjaspx.DB;
using Fjaspx.Common;
namespace Fjaspx.UI.Web
{
    /// <summary>
    /// 
    /// </summary>
    public partial class Administrator_login_index : UserPage
    {
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        /// <summary>
        /// Handles the Click event of the ImageButton1 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Web.UI.ImageClickEventArgs"/> instance containing the event data.</param>
        protected void ImageButton1_Click(object sender, System.Web.UI.ImageClickEventArgs e)
        {
            try
            {
                if (username.Text.Trim() == "admin")// && password.Text.Trim() ==___WebConfig.password
                {
                    Fjaspx.Common.Session.Add("administrator", username.Text.Trim());
                    Fjaspx.Common.cooks.SaveCookie("administrator", username.Text.Trim(), 9999);
                    if (Fjaspx.Common.Session.Get("administrator") != null)
                    {
                       Response.Redirect("~/administrator/index.aspx");
                    }
                }
                else
                {
                    MessageBox.Show(this, "错误！");
                }
            }
            catch { Fjaspx.Common.SystemCms.InsertErrLog("总后台登录错误！", Request.PhysicalPath); }
        }
    }
}